﻿Imports System.Configuration
Public Class NhapMatKhau

    Dim tuformcha As Boolean = False

    Public Sub FormCha()
        tuformcha = True
    End Sub

    Private Sub btnDangNhap_Click(sender As System.Object, e As System.EventArgs) Handles btnDangNhap.Click
        Dim pw As String = ConfigurationManager.AppSettings("ConnectionString")
        If txtMatKhau.Text = pw Then
            lbKetQuaMatKhau.Visible = False
            If tuformcha = True Then
                Dim mdiparent As Main = DirectCast(Me.MdiParent, Main)
                mdiparent.DangNhap()
            End If
            Me.Close()
        Else
            lbKetQuaMatKhau.Visible = True
            txtMatKhau.Text = ""
        End If
    End Sub

    Private Sub btnHuy_Click(sender As System.Object, e As System.EventArgs) Handles btnHuy.Click
        Me.Close()
    End Sub
End Class